import Mock from 'mockjs2'
import { builder } from '../util'

const doctorList = []
const manageList = []
for (let i = 0; i < 10; i++) {
  const manage = {
    name: Mock.mock('@cname'),
    avatar: '/user.svg',
    description: Mock.mock('@cparagraph(1,2)'),
    owner: Mock.mock('@cname'),
    startAt: Mock.mock('@datetime(2020-MM-dd HH:mm:ss)'),
    progress: {
      value: Mock.mock('@integer(0,100)')
    }
  }
  manageList.push(manage)
}

for (var i = 0; i < 10; i++) {
  const doctor = {
    id: Mock.mock('@increment'),
    name: Mock.mock('@cname'),
    age: Mock.mock('@integer(30,75)'),
    gender: Mock.mock('@integer(0,1)'),
    carType: Mock.mock('@integer(0,2)'),
    carId: Mock.mock('@integer(110000000000000000,990000000000000000)'),
    phone: Mock.mock('@integer(13000000000,18000000000)'),
    department: Mock.mock('@integer(0,5)'),
    level: Mock.mock('@integer(0,3)')
  }
  doctorList.push(doctor)
}

const doctors = () => {
  return builder(doctorList)
}
const del = (id) => {
  return builder()
}
const management = () => {
  return builder(manageList)
}

Mock.mock(/\/doctor\/get/, 'get', doctors)
Mock.mock(/\/doctor\/del/, 'post', del)
Mock.mock(/\/doctor\/manage/, 'get', management)
